package com.th.common.annotation;

import com.th.common.constants.CacheConstant;
import com.th.common.enums.CacheType;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * @author ErrorRua
 * @date 2023/06/24
 * @description:
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DoubleCache {
    String cacheName();
    String key(); //支持springEl表达式
    long l2TimeOut() default 120;
    TimeUnit l2TimeUnit() default TimeUnit.SECONDS;
    CacheType type() default CacheType.FULL;

    String l1CacheName() default CacheConstant.DEFAULT_CACHE_NAME;
}

